package com.example.base_kotlin_xml.model

import com.example.base_kotlin_xml.model.repository.TestRepository
import com.example.base_kotlin_xml.model.repository.TestRepositoryImpl
import com.example.base_kotlin_xml.model.source.TestDataSource
import com.example.base_kotlin_xml.model.source.TestRemoteDataSource
import com.example.base_model.api.ApiService
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

/**
 * @Author jiangKunKun
 * @CreateDate 2025/8/6
 * @Description
 * @SpittingGrooves
 */
@Module
@InstallIn(SingletonComponent::class)
abstract class RepositoryModule {
    @Binds
    abstract fun bindTestRepository(
        testRepositoryImpl: TestRepositoryImpl
    ): TestRepository

    companion object {
        @Provides
        @Singleton
        fun provideTestDataSource(
            apiService: ApiService
        ): TestDataSource = TestRemoteDataSource(apiService)
    }
}